#pragma once

#include "wxtl/Interlock.h"

#include "wxtl\Fiber.h"
#include "I_Io.h"

#include "IocpFiber.h"

class BaseFiberServer;
class IocpIoBaseInitiator;

class BaseFiberClientHandler :public IocpFiber
{
public:
	BaseFiberClientHandler();
	virtual ~BaseFiberClientHandler();

	virtual void DoWork(IocpIoBaseInitiator* io);
	void SetIo(IocpIoBaseInitiator* io);
	void SetServer(BaseFiberServer* server);

protected:
	BaseFiberServer* GetServer();

private:
	virtual void Run();
	IocpIoBaseInitiator* m_io;
	BaseFiberServer* m_server;
};